//
//  DanXiangBingDetailViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/16.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "DanXiangBingDetailViewController.h"
#import "AFNetworking.h"
#import "OnLineProductModel.h"
#import "MyOrderViewController.h"



@interface DanXiangBingDetailViewController ()<UIScrollViewDelegate>

@property (nonatomic, strong) UIScrollView *backGroundView; // 背景

@property (nonatomic, strong) NSMutableArray *zhiBingYinSuArray; // 致病因素数组

@property (nonatomic, strong) NSMutableArray *zhiBingYinSuBackGroundColorArray; // 致病因素颜色数组

@property (nonatomic, strong) NSString *danXiangJianJie; // 单项病的简介

@property (nonatomic, strong) NSMutableString *jiBingTeDian; // 疾病特点

@property (nonatomic, strong) NSString *yuFangCuoShiImageUrl; // 预防措施链接

@property (nonatomic, strong) NSMutableArray *yuFangCuoShiBackGroundColorArray; // 预防措施颜色数组

@property (nonatomic, strong) NSMutableArray *yuFangCuoShiDataArray; // 预防措施数据源

@property (nonatomic, strong) NSMutableString *linChuangBiaoXian; // 临床表现

@property (nonatomic, strong) NSMutableString *ruHeZheDuan; // 如何诊断

@property (nonatomic, strong) NSString *jiBingName; // 疾病名字

@property (nonatomic, strong) NSString *yiChuanDu; // 遗传度

@property (nonatomic, strong) NSString *huanBingLv; // 患病率

@property (nonatomic, strong) NSString *siWangLv; // 死亡率

@property (nonatomic, strong) NSMutableArray *zhiLiaoFangFaArray; // 治疗方法数组

@property (nonatomic, strong) NSMutableArray *zhiLiaoFangFaBackGroundColorArray; // 治疗方法颜色数组
@property (nonatomic, strong) UILabel *productPackageNameLabel; // 左上角的疾病名字

@property (nonatomic, strong) NSString *jiBingTuPian; // 疾病图片

@property (nonatomic, strong) OnLineProductModel *onLineProductModel; // 上线产品model
@property (nonatomic, strong) NSMutableArray *onLineProductArray; // 上线产品数组

@property (nonatomic, strong) NSTimer *myTimer; // 检查请求是否超时
@property (nonatomic, assign) NSInteger numberOfTime; // 存储请求时间



@end

@implementation DanXiangBingDetailViewController

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
    // 关闭动画
    [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
    // 关闭计时器
    [self.myTimer invalidate];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // navi的修改
    [self changeNavigation];
    //  [self addMySubview];
    // 检查网络并添加数据源
    [self searchNetAndAddData];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    
    // 左边
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    UIBarButtonItem *leftFirstItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    
    self.productPackageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
    //self.productPackageNameLabel.text = @"疾病名字";
    self.productPackageNameLabel.textColor = [UIColor whiteColor];
    self.productPackageNameLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    self.productPackageNameLabel.textAlignment = NSTextAlignmentLeft;
    UIBarButtonItem *leftSecondItem = [[UIBarButtonItem alloc] initWithCustomView:_productPackageNameLabel];
    self.navigationItem.leftBarButtonItems = @[leftFirstItem, leftSecondItem];
    
    
    
//    //右边
//    UIImageView *fenxiangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//    fenxiangImageV.image = [UIImage imageNamed:@"fenxiang"];
//    UITapGestureRecognizer *fenxiangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fenxiang:)];
//    [fenxiangImageV addGestureRecognizer:fenxiangTapGes];
//    UIBarButtonItem *rightFirstItem = [[UIBarButtonItem alloc] initWithCustomView:fenxiangImageV];
//    
//    
//    self.navigationItem.rightBarButtonItem = rightFirstItem;
    
    
}

#pragma mark - 返回
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 分享
- (void)fenxiang:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"分享");
}

#pragma mark - 检查网络并建立数据源
- (void)searchNetAndAddData
{
    if ([[[NetStatusHandle shareHandle] getNetStatus] isEqualToString:@"YES"]) {
        [self addData];
        // 建立计数器
        self.myTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(goTimeOnDanXiang:) userInfo:nil repeats:YES];
        self.numberOfTime = 0;
        [[NSRunLoop currentRunLoop] addTimer:self.myTimer forMode:NSRunLoopCommonModes];
        // 开启加载动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] startAnimation];
    } else {
        NSLog(@"没有网络");
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kNoNetNoRefresh ToView:self];
    }
    
}

#pragma mark - 计时器方法
- (void)goTimeOnDanXiang:(NSTimer *)timer
{
    self.numberOfTime++;
    NSLog(@"具体单项页请求时间:%ld", self.numberOfTime);
    if (self.numberOfTime > 10) {
        NSLog(@"具体单项页请求超时");
        self.numberOfTime = 0;
        [self.myTimer invalidate];
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kQingQiuChaoShiNoReFresh ToView:self];
    }
}

#pragma mark - 添加数据
- (void)addData
{
    // 致病因素数组
    // self.zhiBingYinSuArray = [NSMutableArray arrayWithObjects:@"张国文掌故沃恩张国文掌故沃恩张国文掌故沃恩", @"王力宏阿斯蒂芬王力宏阿斯蒂芬", @"周杰伦阿道夫啊周杰伦阿道夫啊周杰伦阿道夫啊周杰伦阿道夫啊周杰伦阿道夫啊", @"林俊杰我爱你林俊杰我爱你林俊杰我爱你林俊杰我爱你林俊杰我爱你林俊杰我爱你", nil];
    // 致病因素背景颜色数组
    self.zhiBingYinSuBackGroundColorArray = [NSMutableArray arrayWithObjects:[UIColor colorWithRed:244 / 255.0 green:168 / 255.0 blue:37 / 255.0 alpha:1], [UIColor colorWithRed:78 / 255.0 green:182 / 255.0 blue:234 / 255.0 alpha:1], [UIColor colorWithRed:148 / 255.0 green:191 / 255.0 blue:72 / 255.0 alpha:1], [UIColor colorWithRed:63 / 255.0 green:154 / 255.0 blue:162 / 255.0 alpha:1], [UIColor colorWithRed:208 / 255.0 green:199 / 255.0 blue:94 / 255.0 alpha:1], [UIColor colorWithRed:214 / 255.0 green:103 / 255.0 blue:146 / 255.0 alpha:1], [UIColor colorWithRed:244 / 255.0 green:168 / 255.0 blue:37 / 255.0 alpha:1], [UIColor colorWithRed:78 / 255.0 green:182 / 255.0 blue:234 / 255.0 alpha:1], [UIColor colorWithRed:148 / 255.0 green:191 / 255.0 blue:72 / 255.0 alpha:1], [UIColor colorWithRed:63 / 255.0 green:154 / 255.0 blue:162 / 255.0 alpha:1], [UIColor colorWithRed:208 / 255.0 green:199 / 255.0 blue:94 / 255.0 alpha:1], [UIColor colorWithRed:214 / 255.0 green:103 / 255.0 blue:146 / 255.0 alpha:1],[UIColor colorWithRed:244 / 255.0 green:168 / 255.0 blue:37 / 255.0 alpha:1], [UIColor colorWithRed:78 / 255.0 green:182 / 255.0 blue:234 / 255.0 alpha:1], [UIColor colorWithRed:148 / 255.0 green:191 / 255.0 blue:72 / 255.0 alpha:1], [UIColor colorWithRed:63 / 255.0 green:154 / 255.0 blue:162 / 255.0 alpha:1], [UIColor colorWithRed:208 / 255.0 green:199 / 255.0 blue:94 / 255.0 alpha:1], [UIColor colorWithRed:214 / 255.0 green:103 / 255.0 blue:146 / 255.0 alpha:1],nil];
    
    // 治疗方法数组
    //    self.zhiLiaoFangFaArray = [NSMutableArray arrayWithObjects:@"taylorswift1120", @"周杰伦冲洗后覅殴打，周杰伦冲洗后覅殴打周杰伦冲洗后覅殴打周杰伦冲洗后覅殴打 ", @"陶喆你四分。", @"小非农期二年内工作GV小非农期二年内工作GV，小非农期二年内工作GV小非农期二年内工作GV小非农期二年内工作GV小非农期二年内工作GV", @"为子女为我去拿工资", @"这是你覆盖IE文青女啊IQIT闹个农村那个壹度数高乃 三角形哪个为核心还是你喜欢过", nil];
    // 治疗方法颜色数组
    self.zhiLiaoFangFaBackGroundColorArray = [NSMutableArray arrayWithObjects:[UIColor colorWithRed:118 / 255.0 green:186 / 255.0 blue:63 / 255.0 alpha:1], [UIColor colorWithRed:230 / 255.0 green:112 / 255.0 blue:20 / 255.0 alpha:1], [UIColor colorWithRed:125 / 255.0 green:168 / 255.0 blue:218 / 255.0 alpha:1], [UIColor colorWithRed:152 / 255.0 green:188 / 255.0 blue:196 / 255.0 alpha:1], [UIColor colorWithRed:173 / 255.0 green:217 / 255.0 blue:201 / 255.0 alpha:1], [UIColor colorWithRed:224 / 255.0 green:126 / 255.0 blue:164 / 255.0 alpha:1],[UIColor colorWithRed:118 / 255.0 green:186 / 255.0 blue:63 / 255.0 alpha:1], [UIColor colorWithRed:230 / 255.0 green:112 / 255.0 blue:20 / 255.0 alpha:1], [UIColor colorWithRed:125 / 255.0 green:168 / 255.0 blue:218 / 255.0 alpha:1], [UIColor colorWithRed:152 / 255.0 green:188 / 255.0 blue:196 / 255.0 alpha:1], [UIColor colorWithRed:173 / 255.0 green:217 / 255.0 blue:201 / 255.0 alpha:1], [UIColor colorWithRed:224 / 255.0 green:126 / 255.0 blue:164 / 255.0 alpha:1],[UIColor colorWithRed:118 / 255.0 green:186 / 255.0 blue:63 / 255.0 alpha:1], [UIColor colorWithRed:230 / 255.0 green:112 / 255.0 blue:20 / 255.0 alpha:1], [UIColor colorWithRed:125 / 255.0 green:168 / 255.0 blue:218 / 255.0 alpha:1], [UIColor colorWithRed:152 / 255.0 green:188 / 255.0 blue:196 / 255.0 alpha:1], [UIColor colorWithRed:173 / 255.0 green:217 / 255.0 blue:201 / 255.0 alpha:1], [UIColor colorWithRed:224 / 255.0 green:126 / 255.0 blue:164 / 255.0 alpha:1],  nil];
    
    // 预防措施颜色数组
    self.yuFangCuoShiBackGroundColorArray = [NSMutableArray arrayWithObjects:[UIColor colorWithRed:135 / 255.0 green:194 / 255.0 blue:80 / 255.0 alpha:1], [UIColor colorWithRed:181 / 255.0 green:158 / 255.0 blue:202 / 255.0 alpha:1], [UIColor colorWithRed:217 / 255.0 green:206 / 255.0 blue:112 / 255.0 alpha:1], [UIColor colorWithRed:161 / 255.0 green:212 / 255.0 blue:195 / 255.0 alpha:1], [UIColor colorWithRed:224 / 255.0 green:126 / 255.0 blue:164 / 255.0 alpha:1], [UIColor colorWithRed:111 / 255.0 green:190 / 255.0 blue:208 / 255.0 alpha:1], [UIColor colorWithRed:142 / 255.0 green:183 / 255.0 blue:225 / 255.0 alpha:1], [UIColor colorWithRed:237 / 255.0 green:132 / 255.0 blue:21 / 255.0 alpha:1], [UIColor colorWithRed:168 / 255.0 green:199 / 255.0 blue:206 / 255.0 alpha:1], [UIColor colorWithRed:135 / 255.0 green:194 / 255.0 blue:80 / 255.0 alpha:1], [UIColor colorWithRed:181 / 255.0 green:158 / 255.0 blue:202 / 255.0 alpha:1], [UIColor colorWithRed:217 / 255.0 green:206 / 255.0 blue:112 / 255.0 alpha:1], [UIColor colorWithRed:161 / 255.0 green:212 / 255.0 blue:195 / 255.0 alpha:1], [UIColor colorWithRed:224 / 255.0 green:126 / 255.0 blue:164 / 255.0 alpha:1], [UIColor colorWithRed:111 / 255.0 green:190 / 255.0 blue:208 / 255.0 alpha:1], [UIColor colorWithRed:142 / 255.0 green:183 / 255.0 blue:225 / 255.0 alpha:1], [UIColor colorWithRed:237 / 255.0 green:132 / 255.0 blue:21 / 255.0 alpha:1], [UIColor colorWithRed:168 / 255.0 green:199 / 255.0 blue:206 / 255.0 alpha:1], nil];
    
    // 请求网址
    NSString *url = [NSString stringWithFormat:@"http://120.26.129.84/api/disease/detail/%@", self.danXiangID];
    //   NSString *url = [NSString stringWithFormat:@"http://192.168.11.115/api/disease/detail/71"];
    
    // 请求数据
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    [manager GET:url parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        if (!responseObject) {
            return;
        }
        
        self.numberOfTime = 0;
        [self.myTimer invalidate];
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 疾病名字
        self.jiBingName = [responseObject valueForKey:@"name"];
        // 疾病图片
        self.jiBingTuPian = [responseObject valueForKey:@"img_url"];
        // 疾病简介
        self.danXiangJianJie = [responseObject valueForKey:@"summary"];
        // 遗传度
        self.yiChuanDu = [NSString stringWithFormat:@"%@", [responseObject valueForKey:@"inherit_rate"]];
        NSLog(@"遗传度:%@",self.yiChuanDu);
        NSLog(@"遗传度长度:%ld", self.yiChuanDu.length);
        // 患病率
        self.huanBingLv = [NSString stringWithFormat:@"%@", [responseObject valueForKey:@"prevalence"]] ;
        // 死亡率
        self.siWangLv = [NSString stringWithFormat:@"%@", [responseObject valueForKey:@"death_rate"]];
        // 致病因素
        self.zhiBingYinSuArray = [NSMutableArray array];
        NSArray *nosogenesisArray = [responseObject valueForKey:@"nosogenesis"];
        for (NSString *tempString in nosogenesisArray) {
            [self.zhiBingYinSuArray addObject:tempString];
        }
        // 疾病特点
        NSArray *characteristicArray = [responseObject valueForKey:@"characteristic"];
        self.jiBingTeDian = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < characteristicArray.count; i++) {
            NSString *tempString3 = characteristicArray[i];
            NSString *resultString = @"";
            if (i == (characteristicArray.count - 1)) {
                resultString = [NSString stringWithFormat:@"    %@", tempString3];
            } else {
                resultString = [NSString stringWithFormat:@"    %@\n", tempString3];
            }
            [self.jiBingTeDian appendString:resultString];
        }
        
        // 预防措施图片
        //     self.yuFangCuoShiImageUrl = [responseObject valueForKey:@"preventive_img_url"];
        // 预防措施
        self.yuFangCuoShiDataArray = [NSMutableArray array];
        NSArray *yuFangArray = [responseObject valueForKey:@"preventive"];
        for (int i = 0; i < yuFangArray.count; i++) {
            NSString *tempString = yuFangArray[i];
            NSString *resultString = [NSString stringWithFormat:@"%d、%@", i + 1, tempString];
            [self.yuFangCuoShiDataArray addObject:resultString];
        }
        
        // 临床表现
        NSArray *clinicalArray = [responseObject valueForKey:@"clinical_feature"];
        self.linChuangBiaoXian = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < clinicalArray.count; i++) {
            NSString *tempString1 = clinicalArray[i];
            NSString *resultString = @"";
            if (i == (clinicalArray.count - 1)) {
                resultString = [NSString stringWithFormat:@"%d.%@", i + 1, tempString1];
            } else {
                resultString = [NSString stringWithFormat:@"%d.%@\n", i + 1, tempString1];
            }
            
            [self.linChuangBiaoXian appendString:resultString];
        }
        // 如何诊断
        NSArray *diagnoseArray = [responseObject valueForKey:@"diagnose"];
        self.ruHeZheDuan = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < diagnoseArray.count; i++) {
            NSString *tempString2 = diagnoseArray[i];
            NSString *resultString = @"";
            if (i == (diagnoseArray.count - 1)) {
                resultString = [NSString stringWithFormat:@"%d.%@", i + 1, tempString2];
            } else {
                resultString = [NSString stringWithFormat:@"%d.%@\n", i + 1, tempString2];
            }
            [self.ruHeZheDuan appendString:resultString];
        }
        // 治疗方法
        self.zhiLiaoFangFaArray = [NSMutableArray array];
        NSArray *health_advanceArray = [responseObject valueForKey:@"health_advance"];
        for (NSString *tempString in health_advanceArray) {
            [self.zhiLiaoFangFaArray addObject:tempString];
        }
        
        // 上线产品
        NSArray *productionsArray = [responseObject valueForKey:@"productions"];
        self.onLineProductArray = [NSMutableArray array];
        for (NSDictionary *tempDic in productionsArray) {
            OnLineProductModel *model = [[OnLineProductModel alloc] init];
            [model setValuesForKeysWithDictionary:tempDic];
            [self.onLineProductArray addObject:model];
        }
        
        // 添加疾病名字
        self.productPackageNameLabel.text = self.jiBingName;
        
        [self addMySubview];
        
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"请求失败");
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:@"请求数据失败，请返回上一页后重新进入" ToView:self];
        // 暂停计时器
        [self.myTimer invalidate];
        self.numberOfTime = 0;
    }];
    
}

#pragma mark - 布局
- (void)addMySubview
{
    //    UIImageView *image1 = [[UIImageView alloc] initWithFrame:CGRectMake((375 - 318) / 2 * kAdjustParamater, 100, 318 * kAdjustParamater, 350 * kAdjustParamater)];
    //    image1.image = [UIImage imageNamed:@"danxiangshili-danxiang.jpg"];
    //    [self.view addSubview:image1];
    self.backGroundView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    self.backGroundView.backgroundColor = [UIColor whiteColor];
    self.backGroundView.contentSize = CGSizeMake(kScreenWidth, 5 * kScreenHeight);
    self.backGroundView.delegate = self;
    self.backGroundView.bounces = NO;
    [self.view addSubview:_backGroundView];
    
#warning 疾病简介
    
    // 疾病简介图标
    UIImageView *jiBingJianJieTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    jiBingJianJieTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:jiBingJianJieTuBiaoImageV];
    
    // 疾病简介标题
    UILabel *jiBingJianJieTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(jiBingJianJieTuBiaoImageV.right + 10 * kAdjustParamater, jiBingJianJieTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    jiBingJianJieTitleLabel.text = @"疾病简介";
    jiBingJianJieTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    jiBingJianJieTitleLabel.textAlignment = NSTextAlignmentLeft;
    jiBingJianJieTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:jiBingJianJieTitleLabel];
    
    // 疾病简介图标下方灰色条
    UILabel *grayLineOnjiBingJianJieTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jiBingJianJieTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnjiBingJianJieTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnjiBingJianJieTuBiaoBottom];
    
    // 单项疾病大图标
    UIImageView *jibingImageV = [[UIImageView alloc] initWithFrame:CGRectMake(50 * kAdjustParamater, grayLineOnjiBingJianJieTuBiaoBottom.bottom + 23 * kAdjustParamater, 275 * kAdjustParamater, 178 * kAdjustParamater)];
    NSString *jiBingTuPianUrl = [self.jiBingTuPian stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [jibingImageV sd_setImageWithURL:[NSURL URLWithString:jiBingTuPianUrl] placeholderImage:[UIImage imageNamed:@""]];
    jibingImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundView addSubview:jibingImageV];
    
    
    CGFloat saveJiBingJianJieGrayLineStart = 0.0; // 保存疾病简介灰色条的开始位置
    
    // 百分号
    NSString *baiFenHao = @"%";
    
    // 遗传度左边全长条
    UILabel *yiChuanDuQuanChangLabel = [[UILabel alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, jibingImageV.bottom + 40 * kAdjustParamater, 240 * kAdjustParamater, 10 * kAdjustParamater)];
    yiChuanDuQuanChangLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.13];
    [self.backGroundView addSubview:yiChuanDuQuanChangLabel];
    // 计算遗传度的横条
    float yiChuanDuFloat = [self.yiChuanDu floatValue];
    if ([self.yiChuanDu isEqualToString:@"<null>"] || [self.yiChuanDu isEqualToString:@"0.000000"] || yiChuanDuFloat == 0) {
        self.yiChuanDu = @"";
    }
    CGFloat yiChuanDuCount = [self.yiChuanDu floatValue] * 100;
    CGFloat yiChuanDuWidth = 240.0 / 100 * yiChuanDuCount;
    if (yiChuanDuWidth > 240 * kAdjustParamater) {
        yiChuanDuWidth = 240 * kAdjustParamater;
    }
    // 遗传度的横条
    UILabel *yiChuanDuHengTiaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, jibingImageV.bottom + 40 * kAdjustParamater, yiChuanDuWidth, 10 * kAdjustParamater)];
    yiChuanDuHengTiaoLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
    [self.backGroundView addSubview:yiChuanDuHengTiaoLabel];
    // 遗传度标题
    UILabel *yiChuanDuTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(yiChuanDuQuanChangLabel.right + 13 * kAdjustParamater, yiChuanDuQuanChangLabel.top, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    yiChuanDuTitleLabel.text = @"遗传度";
    yiChuanDuTitleLabel.textColor = [UIColor blackColor];
    yiChuanDuTitleLabel.textAlignment = NSTextAlignmentLeft;
    yiChuanDuTitleLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:yiChuanDuTitleLabel];
    // 遗传度数值
    UILabel *yiChuanDuShuZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(yiChuanDuTitleLabel.left, yiChuanDuTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    yiChuanDuShuZhiLabel.text = [NSString stringWithFormat:@"%.2f%@", yiChuanDuCount, baiFenHao];
    yiChuanDuShuZhiLabel.textAlignment = NSTextAlignmentLeft;
    yiChuanDuShuZhiLabel.textColor = [UIColor blackColor];
    yiChuanDuShuZhiLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:yiChuanDuShuZhiLabel];
    
    // 患病率左边标尺
    UIImageView *huanBingLvmageV = [[UIImageView alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, yiChuanDuShuZhiLabel.bottom + 20 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater)];
    huanBingLvmageV.image = [UIImage imageNamed:@"患病率30%"];
    //   huanBingLvmageV.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    [self.backGroundView addSubview:huanBingLvmageV];
    
    // 计算患病率的长度
    float huanbingLvFloat = [self.huanBingLv floatValue];
    if ([self.huanBingLv isEqualToString:@"<null>"] || [self.huanBingLv isEqualToString:@"0.000000"] || huanbingLvFloat == 0) {
        self.huanBingLv = @"";
    }
    
    
    CGFloat huanBingCount = [self.huanBingLv floatValue];
    CGFloat huanBingLvBiLi = 0.0;
    CGFloat huanBingLvWidth = 0.0;
    if (huanBingCount > 5 && huanBingCount <= 10) {
        // 说明患病率大于5%小于10%
        huanBingLvBiLi = 25.0 / 500 * kAdjustParamater;
        //    NSLog(@"患病比例= %f", huanBingLvBiLi);
        CGFloat yuXia = huanBingCount - 5;
        huanBingLvWidth = huanBingLvBiLi * (yuXia / (0.01)) + 125 * kAdjustParamater;
        //     NSLog(@"患病长度 = %f", huanBingLvWidth);
    } else if (huanBingCount > 10 && huanBingCount <= 30) {
        // 患病率大于10%小于30%
        huanBingLvBiLi = 50.0 / 2000 * kAdjustParamater;
        CGFloat yuXia = huanBingCount - 10;
        huanBingLvWidth = 150 * kAdjustParamater + (yuXia / 0.01) * huanBingLvBiLi;
    } else if (huanBingCount > 0 && huanBingCount <= 5) {
        huanBingLvBiLi = 125.0 / 500 * kAdjustParamater;
        huanBingLvWidth = huanBingLvBiLi * (huanBingCount / 0.01);
    } else if (huanBingCount > 30) {
        huanBingLvWidth = 240 * kAdjustParamater;
    }
    NSLog(@"患病数值 = %f", huanBingCount);
    NSLog(@"患病长度 = %f", huanBingLvWidth);
    // 患病率横条
    UILabel *huanBingLvHengTiaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, huanBingLvmageV.top + 3 * kAdjustParamater, huanBingLvWidth, 9 * kAdjustParamater)];
    huanBingLvHengTiaoLabel.backgroundColor = [UIColor colorWithRed:234 / 255.0 green:84 / 255.0 blue:21 / 255.0 alpha:1];
    [self.backGroundView addSubview:huanBingLvHengTiaoLabel];
    
    
    // 患病率标题
    UILabel *huanBingLvTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(yiChuanDuTitleLabel.left, yiChuanDuShuZhiLabel.bottom + 23 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    huanBingLvTitleLabel.text = @"患病率";
    huanBingLvTitleLabel.textColor = [UIColor blackColor];
    huanBingLvTitleLabel.textAlignment = NSTextAlignmentLeft;
    huanBingLvTitleLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:huanBingLvTitleLabel];
    
    
    
    
    
    // 患病率数值
    UILabel *huanBingLvShuZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(huanBingLvTitleLabel.left, huanBingLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    huanBingLvShuZhiLabel.text = [NSString stringWithFormat:@"%.2f%@", huanBingCount, baiFenHao];
    huanBingLvShuZhiLabel.textColor = [UIColor blackColor];
    huanBingLvShuZhiLabel.textAlignment = NSTextAlignmentLeft;
    huanBingLvShuZhiLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:huanBingLvShuZhiLabel];
    
    // 死亡率左边的图片
    UIImageView *siWangLvLeftImageV = [[UIImageView alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, huanBingLvShuZhiLabel.bottom + 20 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater)];
    siWangLvLeftImageV.image = [UIImage imageNamed:@"标尺-01"];
    //  siWangLvLeftImageV.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
    [self.backGroundView addSubview:siWangLvLeftImageV];
    // 计算死亡率长度
    float siWangLvFloat = [self.siWangLv floatValue];
    if ([self.siWangLv isEqualToString:@"<null>"] || [self.siWangLv isEqualToString:@"0.000000"] || siWangLvFloat == 0) {
        self.siWangLv = @"";
    }
    CGFloat siWangCount = [self.siWangLv floatValue];
    CGFloat siWangLvBiLi = 144.0 / 500 * kAdjustParamater;
    CGFloat siWangWidth = 0.0;
    CGFloat siWangLvBiLiDaYuWuBai = 96.0 / 99500 * kAdjustParamater;
    if ((siWangCount / 0.00001) <= 500) {
        siWangWidth = siWangLvBiLi * (siWangCount / 0.00001);
    } else if ((siWangCount / 0.00001) > 500) {
        siWangWidth = siWangLvBiLiDaYuWuBai * ((siWangCount / 0.00001) - 500) + 144 * kAdjustParamater;
    }
    NSLog(@"死亡长度 = %f", siWangWidth);
    // 死亡率左边的横条
    UILabel *siWangLvHengTiaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(40 * kAdjustParamater, siWangLvLeftImageV.top + 2 * kAdjustParamater, siWangWidth, 9 * kAdjustParamater)];
    siWangLvHengTiaoLabel.backgroundColor = [UIColor colorWithRed:146 / 255.0 green:8 /255.0 blue:131 / 255.0 alpha:1];
    [self.backGroundView addSubview:siWangLvHengTiaoLabel];
    
    // 死亡率标题
    UILabel *siWangLvTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(yiChuanDuTitleLabel.left, huanBingLvShuZhiLabel.bottom + 23 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    siWangLvTitleLabel.text = @"死亡率";
    siWangLvTitleLabel.textColor = [UIColor blackColor];
    siWangLvTitleLabel.textAlignment = NSTextAlignmentLeft;
    siWangLvTitleLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:siWangLvTitleLabel];
    
    // 死亡率数值
    UILabel *siWangLvShuZhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(siWangLvTitleLabel.left, siWangLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater)];
    // siWangLvShuZhiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    siWangLvShuZhiLabel.text = [NSString stringWithFormat:@"%.0f/10万", siWangCount * 100000];
    siWangLvShuZhiLabel.textColor = [UIColor blackColor];
    siWangLvShuZhiLabel.textAlignment = NSTextAlignmentLeft;
    siWangLvShuZhiLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.backGroundView addSubview:siWangLvShuZhiLabel];
    
    saveJiBingJianJieGrayLineStart = siWangLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    //    NSLog(@"遗传度底部 = %f", yiChuanDuShuZhiLabel.bottom);
    //    NSLog(@"患病率底部 = %f", huanBingLvShuZhiLabel.bottom);
    //    NSLog(@"死亡率底部= %f", siWangLvShuZhiLabel.bottom);
    //    NSLog(@"遗传度标题左边位置 = %f", yiChuanDuTitleLabel.left);
    //    NSLog(@"遗传度标题顶部位置= %f", yiChuanDuTitleLabel.top);
    //    NSLog(@"遗传度数值顶部位置 = %f", yiChuanDuShuZhiLabel.top);
    //    NSLog(@"遗传度左边图片顶部位置 = %f", yiChuanDuQuanChangLabel.top);
    //    NSLog(@"患病率标题顶部位置 = %f", huanBingLvTitleLabel.top);
    //    NSLog(@"患病率数值顶部位置 = %f", huanBingLvShuZhiLabel.top);
    //    NSLog(@"患病率左边图片顶部位置 = %f", huanBingLvmageV.top);
    if (self.yiChuanDu.length != 0 && self.huanBingLv.length == 0 && self.siWangLv.length == 0) {
        // 有遗传度,没有患病率，没有死亡率
        yiChuanDuQuanChangLabel.hidden = NO; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = NO; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = NO; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = NO; // 遗传度大小
        huanBingLvmageV.hidden = YES; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = YES; // 患病率颜色label
        huanBingLvTitleLabel.hidden = YES; // 患病率标题
        huanBingLvShuZhiLabel.hidden = YES; // 患病率大小
        siWangLvLeftImageV.hidden = YES; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = YES; // 死亡率颜色label
        siWangLvTitleLabel.hidden = YES; // 死亡率标题
        siWangLvShuZhiLabel.hidden = YES; // 死亡率数值
        saveJiBingJianJieGrayLineStart = yiChuanDuShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length != 0 && self.huanBingLv.length != 0 && self.siWangLv.length == 0) {
        // 有遗传度，有患病率,没有死亡率
        yiChuanDuQuanChangLabel.hidden = NO; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = NO; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = NO; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = NO; // 遗传度大小
        huanBingLvmageV.hidden = NO; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = NO; // 患病率颜色label
        huanBingLvTitleLabel.hidden = NO; // 患病率标题
        huanBingLvShuZhiLabel.hidden = NO; // 患病率大小
        siWangLvLeftImageV.hidden = YES; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = YES; // 死亡率颜色label
        siWangLvTitleLabel.hidden = YES; // 死亡率标题
        siWangLvShuZhiLabel.hidden = YES; // 死亡率数值
        saveJiBingJianJieGrayLineStart = huanBingLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length != 0 && self.huanBingLv.length == 0 && self.siWangLv != 0) {
        // 有遗传度，有死亡率，没有患病率
        yiChuanDuQuanChangLabel.hidden = NO; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = NO; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = NO; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = NO; // 遗传度大小
        huanBingLvmageV.hidden = YES; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = YES; // 患病率颜色label
        huanBingLvTitleLabel.hidden = YES; // 患病率标题
        huanBingLvShuZhiLabel.hidden = YES; // 患病率大小
        siWangLvLeftImageV.hidden = NO; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = NO; // 死亡率颜色label
        siWangLvTitleLabel.hidden = NO; // 死亡率标题
        siWangLvShuZhiLabel.hidden = NO; // 死亡率数值
        // 需要上移死亡率的所有位置
        //   siWangLvLeftImageV.frame.origin.y = yiChuanDuShuZhiLabel.bottom + 20 * kAdjustParamater;
        siWangLvLeftImageV.frame = CGRectMake(40 * kAdjustParamater, 347.5 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater);
        siWangLvHengTiaoLabel.frame = CGRectMake(40 * kAdjustParamater, siWangLvLeftImageV.top + 2 * kAdjustParamater, siWangWidth, 9 * kAdjustParamater);
        siWangLvTitleLabel.frame = CGRectMake(293 * kAdjustParamater, 350 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        siWangLvShuZhiLabel.frame = CGRectMake(293 * kAdjustParamater, siWangLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        
        saveJiBingJianJieGrayLineStart = siWangLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length != 0 && self.huanBingLv.length != 0 && self.siWangLv.length  != 0) {
        // 全部都有
        yiChuanDuQuanChangLabel.hidden = NO; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = NO; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = NO; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = NO; // 遗传度大小
        huanBingLvmageV.hidden = NO; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = NO; // 患病率颜色label
        huanBingLvTitleLabel.hidden = NO; // 患病率标题
        huanBingLvShuZhiLabel.hidden = NO; // 患病率大小
        siWangLvLeftImageV.hidden = NO; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = NO; // 死亡率颜色label
        siWangLvTitleLabel.hidden = NO; // 死亡率标题
        siWangLvShuZhiLabel.hidden = NO; // 死亡率数值
        saveJiBingJianJieGrayLineStart = siWangLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length == 0 && self.huanBingLv.length != 0 && self.siWangLv.length == 0) {
        // 没有遗传度，没有死亡率，有患病率
        yiChuanDuQuanChangLabel.hidden = YES; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = YES; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = YES; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = YES; // 遗传度大小
        huanBingLvmageV.hidden = NO; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = NO; // 患病率颜色label
        huanBingLvTitleLabel.hidden = NO; // 患病率标题
        huanBingLvShuZhiLabel.hidden = NO; // 患病率大小
        siWangLvLeftImageV.hidden = YES; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = YES; // 死亡率颜色label
        siWangLvTitleLabel.hidden = YES; // 死亡率标题
        siWangLvShuZhiLabel.hidden = YES; // 死亡率数值
        // 需要调整患病率所有的位置
        huanBingLvmageV.frame = CGRectMake(40 * kAdjustParamater, 302.5 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater);
        huanBingLvHengTiaoLabel.frame = CGRectMake(40 * kAdjustParamater, huanBingLvmageV.top + 2 * kAdjustParamater, huanBingLvWidth, 9 * kAdjustParamater);
        huanBingLvTitleLabel.frame = CGRectMake(293 * kAdjustParamater, 302.5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        huanBingLvShuZhiLabel.frame = CGRectMake(293 * kAdjustParamater, huanBingLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        saveJiBingJianJieGrayLineStart = huanBingLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length == 0 && self.huanBingLv.length != 0 && self.siWangLv.length != 0) {
        // 没有遗传度，有患病率，有死亡率
        yiChuanDuQuanChangLabel.hidden = YES; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = YES; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = YES; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = YES; // 遗传度大小
        huanBingLvmageV.hidden = NO; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = NO; // 患病率颜色label
        huanBingLvTitleLabel.hidden = NO; // 患病率标题
        huanBingLvShuZhiLabel.hidden = NO; // 患病率大小
        siWangLvLeftImageV.hidden = NO; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = NO; // 死亡率颜色label
        siWangLvTitleLabel.hidden = NO; // 死亡率标题
        siWangLvShuZhiLabel.hidden = NO; // 死亡率数值
        
        // 需要调整所有患病的位置
        huanBingLvmageV.frame = CGRectMake(40 * kAdjustParamater, 302.5 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater);
        huanBingLvHengTiaoLabel.frame = CGRectMake(40 * kAdjustParamater, huanBingLvmageV.top + 2 * kAdjustParamater, huanBingLvWidth, 9 * kAdjustParamater);
        huanBingLvTitleLabel.frame = CGRectMake(293 * kAdjustParamater, 302.5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        huanBingLvShuZhiLabel.frame = CGRectMake(293 * kAdjustParamater, huanBingLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        // 需要调整所有死亡率的位置
        siWangLvLeftImageV.frame = CGRectMake(40 * kAdjustParamater, 347.5 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater);
        siWangLvHengTiaoLabel.frame = CGRectMake(40 * kAdjustParamater, siWangLvLeftImageV.top + 2 * kAdjustParamater, siWangWidth, 9 * kAdjustParamater);
        siWangLvTitleLabel.frame = CGRectMake(293 * kAdjustParamater, 350.5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        siWangLvShuZhiLabel.frame = CGRectMake(293 * kAdjustParamater, siWangLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        saveJiBingJianJieGrayLineStart = siWangLvShuZhiLabel.bottom + 35 * kAdjustParamater;
    } else if (self.yiChuanDu.length == 0 && self.huanBingLv.length == 0 && self.siWangLv.length != 0) {
        // 没有遗传度，没有患病率，有死亡率
        yiChuanDuQuanChangLabel.hidden = YES; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = YES; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = YES; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = YES; // 遗传度大小
        huanBingLvmageV.hidden = YES; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = YES; // 患病率颜色label
        huanBingLvTitleLabel.hidden = YES; // 患病率标题
        huanBingLvShuZhiLabel.hidden = YES; // 患病率大小
        siWangLvLeftImageV.hidden = NO; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = NO; // 死亡率颜色label
        siWangLvTitleLabel.hidden = NO; // 死亡率标题
        siWangLvShuZhiLabel.hidden = NO; // 死亡率数值
        // 更改所有死亡率的位置
        siWangLvLeftImageV.frame = CGRectMake(40 * kAdjustParamater, 302.5 * kAdjustParamater, 240 * kAdjustParamater, 32 * kAdjustParamater);
        siWangLvHengTiaoLabel.frame = CGRectMake(40 * kAdjustParamater, siWangLvLeftImageV.top + 2 * kAdjustParamater, siWangWidth, 9 * kAdjustParamater);
        siWangLvTitleLabel.frame = CGRectMake(293 * kAdjustParamater, 302.5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        siWangLvShuZhiLabel.frame = CGRectMake(293 * kAdjustParamater, siWangLvTitleLabel.bottom + 5 * kAdjustParamater, 80 * kAdjustParamater, 10 * kAdjustParamater);
        saveJiBingJianJieGrayLineStart = siWangLvShuZhiLabel.bottom + 35 * kAdjustParamater;
        
    } else if (self.yiChuanDu.length == 0 && self.huanBingLv.length == 0 && self.siWangLv.length == 0) {
        // 全部都没有
        yiChuanDuQuanChangLabel.hidden = YES; // 遗传度全长图片
        yiChuanDuHengTiaoLabel.hidden = YES; // 遗传度颜色label
        yiChuanDuTitleLabel.hidden = YES; // 遗传度标题
        yiChuanDuShuZhiLabel.hidden = YES; // 遗传度大小
        huanBingLvmageV.hidden = YES; // 患病率全长图片
        huanBingLvHengTiaoLabel.hidden = YES; // 患病率颜色label
        huanBingLvTitleLabel.hidden = YES; // 患病率标题
        huanBingLvShuZhiLabel.hidden = YES; // 患病率大小
        siWangLvLeftImageV.hidden = YES; // 死亡率全长图片
        siWangLvHengTiaoLabel.hidden = YES; // 死亡率颜色label
        siWangLvTitleLabel.hidden = YES; // 死亡率标题
        siWangLvShuZhiLabel.hidden = YES; // 死亡率数值
        saveJiBingJianJieGrayLineStart = jibingImageV.bottom + 35 * kAdjustParamater;
    }
    
    //
    //
    //
    
    
    
    
    
    
    // 死亡率下方的灰色条
    UILabel *grayLineOnSiWangLvBottom = [[UILabel alloc] initWithFrame:CGRectMake(0,  saveJiBingJianJieGrayLineStart, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnSiWangLvBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundView addSubview:grayLineOnSiWangLvBottom];
    
    // 疾病介绍
    UILabel *jiBingContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, grayLineOnSiWangLvBottom.bottom + 23 * kAdjustParamater, 345 * kAdjustParamater, 100 * kAdjustParamater)];
    //  jiBingContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    //  jiBingContentLabel.text = @"张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文";
    if (self.danXiangJianJie.length == 0) {
        jiBingContentLabel.text = @"";
    } else {
        jiBingContentLabel.text = self.danXiangJianJie;
    }
    
    jiBingContentLabel.font = [UIFont fontWithName:@"ArialMT" size:k16Big];
    jiBingContentLabel.numberOfLines = 0;
    // 自适应行间距
    [jiBingContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:jiBingContentLabel.text lineHeight:8]];
    [jiBingContentLabel sizeToFit];
    [self.backGroundView addSubview:jiBingContentLabel];
    
    // 疾病简介下方的灰色条
    UILabel *grayLineOnJiBingJianJieBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jiBingContentLabel.bottom + 30 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnJiBingJianJieBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:grayLineOnJiBingJianJieBottom];
    
    //    NSLog(@"遗传度 = %.2f", yiChuanDuCount);
    //    NSLog(@"患病率 = %.2f", huanBingCount);
    //    NSLog(@"死亡率 = %.2f", siWangCount * 100000);
    
#warning 致病因素
    
    // 致病因素图标
    UIImageView *zhiBingYinSuTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,grayLineOnJiBingJianJieBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    zhiBingYinSuTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:zhiBingYinSuTuBiaoImageV];
    
    // 致病因素标题
    UILabel *zhiBingYinSuTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(jiBingJianJieTuBiaoImageV.right + 10 * kAdjustParamater, zhiBingYinSuTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    zhiBingYinSuTitleLabel.text = @"致病因素";
    zhiBingYinSuTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    zhiBingYinSuTitleLabel.textAlignment = NSTextAlignmentLeft;
    zhiBingYinSuTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:zhiBingYinSuTitleLabel];
    
    // 致病因素图标下方灰色条
    UILabel *grayLineOnzhiBingYinSuTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, zhiBingYinSuTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnzhiBingYinSuTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnzhiBingYinSuTuBiaoBottom];
    
    // 进行动态致病因素的动态布局
    CGFloat nextFloatZhiBingYinSu = 0.0; // 保存下一个控件的开始位置
    for (int i = 0; i < self.zhiBingYinSuArray.count; i++) {
        NSInteger isJiOrOu = (i + 1) % 2;
        if (isJiOrOu == 1) {
            // 说明是奇数
            // 字体背景
            UIView *ziTiBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(60 * kAdjustParamater,grayLineOnzhiBingYinSuTuBiaoBottom.bottom + 35 * kAdjustParamater + nextFloatZhiBingYinSu, 280 * kAdjustParamater, 70 * kAdjustParamater)];
            ziTiBackGroundView.backgroundColor = self.zhiBingYinSuBackGroundColorArray[i];
            ziTiBackGroundView.tag = 100 + i;
            [self.backGroundView addSubview:ziTiBackGroundView];
            // 内容
            UILabel *zhiBingContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(45 * kAdjustParamater, 12 * kAdjustParamater, 220 * kAdjustParamater, 50 * kAdjustParamater)];
            //    zhiBingContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
            zhiBingContentLabel.text = self.zhiBingYinSuArray[i];
            zhiBingContentLabel.textColor = [UIColor whiteColor];
            zhiBingContentLabel.font = [UIFont systemFontOfSize:k17Big];
            zhiBingContentLabel.numberOfLines = 0;
            [zhiBingContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:zhiBingContentLabel.text lineHeight:8]];
            [zhiBingContentLabel sizeToFit];
            [ziTiBackGroundView addSubview:zhiBingContentLabel];
            ziTiBackGroundView.height = zhiBingContentLabel.height + 24 * kAdjustParamater;
            
            // 数字
            UILabel *shuZiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ziTiBackGroundView.left - 45 * kAdjustParamater, ziTiBackGroundView.top - 13 * kAdjustParamater, 70 * kAdjustParamater, 70 * kAdjustParamater)];
            shuZiTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
            if ((i + 1) >9) {
                shuZiTitleLabel.text = [NSString stringWithFormat:@"%d", i + 1];
            } else {
                shuZiTitleLabel.text = [NSString stringWithFormat:@"0%d", i + 1];
            }
            
            shuZiTitleLabel.textColor = [UIColor whiteColor];
            shuZiTitleLabel.textAlignment = NSTextAlignmentCenter;
            shuZiTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:60 * kAdjustParamater];
            [self.backGroundView addSubview:shuZiTitleLabel];
            
            nextFloatZhiBingYinSu = nextFloatZhiBingYinSu + ziTiBackGroundView.height + 30 * kAdjustParamater;
        } else if (isJiOrOu == 0) {
            // 说明是偶数
            // 字体背景
            UIView *ziTiBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(35 * kAdjustParamater, grayLineOnzhiBingYinSuTuBiaoBottom.bottom + 35 * kAdjustParamater + nextFloatZhiBingYinSu, 280 * kAdjustParamater, 70 * kAdjustParamater)];
            ziTiBackGroundView.tag = 100 + i;
            ziTiBackGroundView.backgroundColor = self.zhiBingYinSuBackGroundColorArray[i];
            [self.backGroundView addSubview:ziTiBackGroundView];
            
            // 内容
            UILabel *zhiBingContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(25 * kAdjustParamater, 12 * kAdjustParamater, 220 * kAdjustParamater, 50 * kAdjustParamater)];
            //     zhiBingContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
            zhiBingContentLabel.text = self.zhiBingYinSuArray[i];
            zhiBingContentLabel.textColor = [UIColor whiteColor];
            zhiBingContentLabel.font = [UIFont systemFontOfSize:k17Big];
            zhiBingContentLabel.numberOfLines = 0;
            [zhiBingContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:zhiBingContentLabel.text lineHeight:8]];
            [zhiBingContentLabel sizeToFit];
            [ziTiBackGroundView addSubview:zhiBingContentLabel];
            ziTiBackGroundView.height = zhiBingContentLabel.height + 24 * kAdjustParamater;
            
            // 数字
            UILabel *shuZiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ziTiBackGroundView.right - 25 * kAdjustParamater, ziTiBackGroundView.top - 13 * kAdjustParamater, 70 * kAdjustParamater, 70 * kAdjustParamater)];
            shuZiTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
            if ((i + 1) >9) {
                shuZiTitleLabel.text = [NSString stringWithFormat:@"%d", i + 1];
            } else {
                shuZiTitleLabel.text = [NSString stringWithFormat:@"0%d", i + 1];
            }
            shuZiTitleLabel.textColor = [UIColor whiteColor];
            shuZiTitleLabel.textAlignment = NSTextAlignmentCenter;
            shuZiTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:60 * kAdjustParamater];
            [self.backGroundView addSubview:shuZiTitleLabel];
            
            nextFloatZhiBingYinSu = nextFloatZhiBingYinSu + ziTiBackGroundView.height + 30 * kAdjustParamater;
        }
    }
    
    // 致病因素下方的灰色条的开始位置
    CGFloat zhiBingYinSuGrayLineStart = 0.0;
    if (self.zhiBingYinSuArray.count == 0) {
        zhiBingYinSuGrayLineStart = grayLineOnzhiBingYinSuTuBiaoBottom.bottom + 35 * kAdjustParamater;
    } else {
        // 获取最后一个致病原因的背景图
        UIView *zuiHouZhiBingYuanYinBackGroundView = (UIView *)[self.view viewWithTag:99 + self.zhiBingYinSuArray.count];
        zhiBingYinSuGrayLineStart = zuiHouZhiBingYuanYinBackGroundView.bottom + 35 * kAdjustParamater;
    }
    
    // 致病因素下方的灰色条
    UILabel *grayLineOnZhiBingYinSuBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, zhiBingYinSuGrayLineStart, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnZhiBingYinSuBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:grayLineOnZhiBingYinSuBottom];
    
#warning 疾病特点
    // 疾病特点图标
    UIImageView *jiBingTeDianTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,grayLineOnZhiBingYinSuBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    jiBingTeDianTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:jiBingTeDianTuBiaoImageV];
    
    // 疾病特点标题
    UILabel *jiBingTeDianTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(jiBingJianJieTuBiaoImageV.right + 10 * kAdjustParamater, jiBingTeDianTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    jiBingTeDianTitleLabel.text = @"疾病特点";
    jiBingTeDianTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    jiBingTeDianTitleLabel.textAlignment = NSTextAlignmentLeft;
    jiBingTeDianTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:jiBingTeDianTitleLabel];
    
    // 疾病特点图标下方灰色条
    UILabel *grayLineOnJiBingTeDianTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jiBingTeDianTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnJiBingTeDianTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnJiBingTeDianTuBiaoBottom];
    
    // 注意
    UILabel *zhuYiLabel = [[UILabel alloc] initWithFrame:CGRectMake(48 * kAdjustParamater, grayLineOnJiBingTeDianTuBiaoBottom.bottom + 12 * kAdjustParamater, 70 * kAdjustParamater, 15 * kAdjustParamater)];
    // zhuYiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    zhuYiLabel.text = @"注意";
    zhuYiLabel.textColor = [UIColor redColor];
    zhuYiLabel.textAlignment = NSTextAlignmentLeft;
    zhuYiLabel.font = [UIFont systemFontOfSize:k17Big];
    [self.backGroundView addSubview:zhuYiLabel];
    // 疾病特点的内容
    UILabel *jiBingTeDianNeiRongLabel = [[UILabel alloc] initWithFrame:CGRectMake(35 * kAdjustParamater, zhuYiLabel.bottom + 15 * kAdjustParamater, 310 * kAdjustParamater, 100 * kAdjustParamater)];
    //  jiBingTeDianNeiRongLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    //  jiBingTeDianNeiRongLabel.text = @"王力宏按市局偶发钱呢我让你小侄女王力宏按市局偶发钱呢我让你小侄女王力宏按市局偶发钱呢我让你小侄女王力宏按市局偶发钱呢我让你小侄女王力宏按市局偶发钱呢我让你小侄女王力宏按市局偶发钱呢我让你小侄女";
    if (self.jiBingTeDian.length == 0) {
        jiBingTeDianNeiRongLabel.text = @"";
    } else {
        jiBingTeDianNeiRongLabel.text = self.jiBingTeDian;
    }
    
    jiBingTeDianNeiRongLabel.textColor = [UIColor blackColor];
    jiBingTeDianNeiRongLabel.font = [UIFont fontWithName:@"ArialMT" size:k16Big];
    jiBingTeDianNeiRongLabel.numberOfLines = 0;
    [jiBingTeDianNeiRongLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:jiBingTeDianNeiRongLabel.text lineHeight:8]];
    [jiBingTeDianNeiRongLabel sizeToFit];
    [self.backGroundView addSubview:jiBingTeDianNeiRongLabel];
    
    // 疾病特点下方的灰色条
    UILabel *graylineJiBingTeDianBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jiBingTeDianNeiRongLabel.bottom + 23 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    graylineJiBingTeDianBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:graylineJiBingTeDianBottom];
    
#warning 预防措施
    
    // 预防措施图标
    UIImageView *yuFangCuoShiTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,graylineJiBingTeDianBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    yuFangCuoShiTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:yuFangCuoShiTuBiaoImageV];
    
    // 预防措施标题
    UILabel *yuFangCuoShiTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(yuFangCuoShiTuBiaoImageV.right + 10 * kAdjustParamater, yuFangCuoShiTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    yuFangCuoShiTitleLabel.text = @"预防措施";
    yuFangCuoShiTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    yuFangCuoShiTitleLabel.textAlignment = NSTextAlignmentLeft;
    yuFangCuoShiTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:yuFangCuoShiTitleLabel];
    
    // 预防措施图标下方灰色条
    UILabel *grayLineOnYuFangCuoShiTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, yuFangCuoShiTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnYuFangCuoShiTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnYuFangCuoShiTuBiaoBottom];
    
    // 预防措施图片
    //    UIImageView *yuFangCuoShiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(30 * kAdjustParamater, grayLineOnYuFangCuoShiTuBiaoBottom.bottom + 25 * kAdjustParamater, 315 * kAdjustParamater, 350 * kAdjustParamater)];
    //    NSString *yuFangCuoShiUrl = [self.yuFangCuoShiImageUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    //    [yuFangCuoShiImageV sd_setImageWithURL:[NSURL URLWithString:yuFangCuoShiUrl] placeholderImage:[UIImage imageNamed:@""]];
    //    //yuFangCuoShiImageV.image = [UIImage imageNamed:@"danxiangshili-danxiang.jpg"];
    //    [self.backGroundView addSubview:yuFangCuoShiImageV];
    
    // 记录下一个预防措施背景的Y开始位置
    CGFloat nextYuFangCuoShiStartY = 0.0;
    // 进行预防措施的动态布局
    for (int i = 0; i < self.yuFangCuoShiDataArray.count; i++) {
        // 预防措施背景
        UIView *yuFangCuoShiBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(25 * kAdjustParamater, grayLineOnYuFangCuoShiTuBiaoBottom.bottom + 25 * kAdjustParamater + nextYuFangCuoShiStartY, 325 * kAdjustParamater, 50 * kAdjustParamater)];
        yuFangCuoShiBackgroundView.backgroundColor = self.yuFangCuoShiBackGroundColorArray[i];
        yuFangCuoShiBackgroundView.tag = 600 + i;
        [self.backGroundView addSubview:yuFangCuoShiBackgroundView];
        
        // 预防措施label
        UILabel *yuFangCuoShiLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 10 * kAdjustParamater, 295 * kAdjustParamater, 40 * kAdjustParamater)];
        //  yuFangCuoShiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
        yuFangCuoShiLabel.text = self.yuFangCuoShiDataArray[i];
        yuFangCuoShiLabel.textColor = [UIColor whiteColor];
        yuFangCuoShiLabel.numberOfLines = 0;
        yuFangCuoShiLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k16Big];
        // 调整行间距
        [yuFangCuoShiLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:yuFangCuoShiLabel.text lineHeight:5]];
        [yuFangCuoShiLabel sizeToFit];
        [yuFangCuoShiBackgroundView addSubview:yuFangCuoShiLabel];
        // 调整预防措施背景的高度
        yuFangCuoShiBackgroundView.height = yuFangCuoShiLabel.height + 20 * kAdjustParamater;
        nextYuFangCuoShiStartY = nextYuFangCuoShiStartY + yuFangCuoShiBackgroundView.height + 2 * kAdjustParamater;
    }
    
    // 取出最后一个预防措施的背景
    UIView *lastYuFangCuoShiBackGroundView = (UIView *)[self.view viewWithTag:599 + self.yuFangCuoShiDataArray.count];
    
    // 预防措施下方的灰色条
    UILabel *grayLineOnYuFangCuoShiBottom =[[UILabel alloc] initWithFrame:CGRectMake(0, lastYuFangCuoShiBackGroundView.bottom + 30 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnYuFangCuoShiBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:grayLineOnYuFangCuoShiBottom];
    
#warning 临床表现
    
    // 临床表现图标
    UIImageView *linChuangBiaoXianTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,grayLineOnYuFangCuoShiBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    linChuangBiaoXianTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:linChuangBiaoXianTuBiaoImageV];
    
    // 临床表现标题
    UILabel *linChuangBiaoXianTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(linChuangBiaoXianTuBiaoImageV.right + 10 * kAdjustParamater, linChuangBiaoXianTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    linChuangBiaoXianTitleLabel.text = @"临床表现";
    linChuangBiaoXianTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    linChuangBiaoXianTitleLabel.textAlignment = NSTextAlignmentLeft;
    linChuangBiaoXianTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:linChuangBiaoXianTitleLabel];
    
    // 临床表现图标下方灰色条
    UILabel *grayLineOnlinChuangBiaoXianTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, linChuangBiaoXianTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnlinChuangBiaoXianTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnlinChuangBiaoXianTuBiaoBottom];
    
    // 临床表现的内容背景
    UIView *linChuangBiaoXianBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, grayLineOnlinChuangBiaoXianTuBiaoBottom.bottom + 30 * kAdjustParamater, 335 * kAdjustParamater, 200 * kAdjustParamater)];
    linChuangBiaoXianBackGroundView.backgroundColor = kCyanColor;
    linChuangBiaoXianBackGroundView.layer.cornerRadius = 6 * kAdjustParamater;
    linChuangBiaoXianBackGroundView.layer.masksToBounds = YES;
    [self.backGroundView addSubview:linChuangBiaoXianBackGroundView];
    
    // 临床表现的内容
    UILabel *linChuangBiaoXianContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(8 * kAdjustParamater, 18 * kAdjustParamater, 320 * kAdjustParamater, 150  * kAdjustParamater)];
    //  linChuangBiaoXianContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    //  linChuangBiaoXianContentLabel.text = @"1.为受检验者及其家庭成员提供遗传信息，预防患病的风险;\n2.早期发现致病基因，及早采取干预措施，可以显著降低发病率;\n3.协助临床医生制定邮箱的个体化质量方案，降低医疗费用。";
    if (self.linChuangBiaoXian.length == 0) {
        linChuangBiaoXianContentLabel.text = @"";
    } else {
        linChuangBiaoXianContentLabel.text = self.linChuangBiaoXian;
    }
    linChuangBiaoXianContentLabel.numberOfLines = 0;
    linChuangBiaoXianContentLabel.font = [UIFont fontWithName:@"ArialMT" size:k16Big];
    linChuangBiaoXianContentLabel.textColor = [UIColor whiteColor];
    // 改变行间距
    [linChuangBiaoXianContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:linChuangBiaoXianContentLabel.text lineHeight:10]];
    [linChuangBiaoXianContentLabel sizeToFit];
    [linChuangBiaoXianBackGroundView addSubview:linChuangBiaoXianContentLabel];
    
    
    // 重新改变背景
    linChuangBiaoXianBackGroundView.height = linChuangBiaoXianContentLabel.height + 36 * kAdjustParamater;
    // 临床表现下方的灰色条
    UILabel *grayLineOnLinChuangBiaoXianBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, linChuangBiaoXianBackGroundView.bottom + 30 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnLinChuangBiaoXianBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:grayLineOnLinChuangBiaoXianBottom];
    
#warning 如何确诊
    
    // 如何确诊图标
    UIImageView *ruHeQueZhenTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,grayLineOnLinChuangBiaoXianBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    ruHeQueZhenTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:ruHeQueZhenTuBiaoImageV];
    
    // 如何确诊标题
    UILabel *ruHeQueZhenTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ruHeQueZhenTuBiaoImageV.right + 10 * kAdjustParamater, ruHeQueZhenTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    ruHeQueZhenTitleLabel.text = @"如何确诊";
    ruHeQueZhenTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    ruHeQueZhenTitleLabel.textAlignment = NSTextAlignmentLeft;
    ruHeQueZhenTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:ruHeQueZhenTitleLabel];
    
    // 如何确诊图标下方灰色条
    UILabel *grayLineOnRuHeQueZhenTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, ruHeQueZhenTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnRuHeQueZhenTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnRuHeQueZhenTuBiaoBottom];
    
    //  NSLog(@"如何确诊 = %@", self.ruHeZheDuan);
    
    // 如何确诊的内容背景
    UIView *ruHeQueZhenBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, grayLineOnRuHeQueZhenTuBiaoBottom.bottom + 30 * kAdjustParamater, 335 * kAdjustParamater, 200 * kAdjustParamater)];
    ruHeQueZhenBackGroundView.backgroundColor = [UIColor colorWithRed:124 / 255.0 green:167 / 255.0 blue:217 / 255.0 alpha:1];
    ruHeQueZhenBackGroundView.layer.cornerRadius = 6 * kAdjustParamater;
    ruHeQueZhenBackGroundView.layer.masksToBounds = YES;
    [self.backGroundView addSubview:ruHeQueZhenBackGroundView];
    
    // 如何确诊的内容
    UILabel *ruHeQueZhenContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(8 * kAdjustParamater, 18 * kAdjustParamater, 320 * kAdjustParamater, 150  * kAdjustParamater)];
    //  linChuangBiaoXianContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    // ruHeQueZhenContentLabel.text = @"1.为受检验者及其家庭成员提供遗传信息，预防患病的风险;\n2.早期发现致病基因，及早采取干预措施，可以显著降低发病率;\n3.协助临床医生制定邮箱的个体化质量方案，降低医疗费用。1111111111";
    if (self.ruHeZheDuan.length == 0) {
        ruHeQueZhenContentLabel.text = @"";
    } else {
        ruHeQueZhenContentLabel.text = self.ruHeZheDuan;
    }
    
    ruHeQueZhenContentLabel.numberOfLines = 0;
    ruHeQueZhenContentLabel.font = [UIFont fontWithName:@"ArialMT" size:k16Big];
    ruHeQueZhenContentLabel.textColor = [UIColor whiteColor];
    // 改变行间距
    [ruHeQueZhenContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:ruHeQueZhenContentLabel.text lineHeight:10]];
    [ruHeQueZhenContentLabel sizeToFit];
    [ruHeQueZhenBackGroundView addSubview:ruHeQueZhenContentLabel];
    
    
    // 重新改变背景
    ruHeQueZhenBackGroundView.height = ruHeQueZhenContentLabel.height + 36 * kAdjustParamater;
    // 如何确诊下方的灰色条
    UILabel *grayLineOnRuHeQueZhenBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, ruHeQueZhenBackGroundView.bottom + 30 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnRuHeQueZhenBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundView addSubview:grayLineOnRuHeQueZhenBottom];
    
#warning 治疗方法
    
    // 治疗方法图标
    UIImageView *zhiLiaoFangFaTuBiaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,grayLineOnRuHeQueZhenBottom.bottom + 20 * kAdjustParamater, 20 * kAdjustParamater, 20 * kAdjustParamater)];
    zhiLiaoFangFaTuBiaoImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundView addSubview:zhiLiaoFangFaTuBiaoImageV];
    
    // 治疗方法标题
    UILabel *zhiLiaoFangFaTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(zhiLiaoFangFaTuBiaoImageV.right + 10 * kAdjustParamater, zhiLiaoFangFaTuBiaoImageV.top, 100 * kAdjustParamater, 20 * kAdjustParamater)];
    zhiLiaoFangFaTitleLabel.text = @"治疗方法";
    zhiLiaoFangFaTitleLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.7];
    zhiLiaoFangFaTitleLabel.textAlignment = NSTextAlignmentLeft;
    zhiLiaoFangFaTitleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k19Big];
    [self.backGroundView addSubview:zhiLiaoFangFaTitleLabel];
    
    // 治疗方法图标下方灰色条
    UILabel *grayLineOnZhiLiaoFangFaTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, zhiLiaoFangFaTuBiaoImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnZhiLiaoFangFaTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundView addSubview:grayLineOnZhiLiaoFangFaTuBiaoBottom];
    
    // 进行治疗方法的动态布局
    CGFloat zhiLiaoFangFaNextHeight = 0.0; // 保存治疗方法的下一次开始位置
    for (int i = 0; i < self.zhiLiaoFangFaArray.count; i++) {
        // 判断奇偶性
        NSInteger jiOrOu = (i + 1) % 2;
        if (jiOrOu == 1) {
            // 说明是奇数
            
            // 数字
            UILabel *shuZiLabel = [[UILabel alloc] initWithFrame:CGRectMake(30 * kAdjustParamater,grayLineOnZhiLiaoFangFaTuBiaoBottom.bottom +  27 * kAdjustParamater + zhiLiaoFangFaNextHeight, 85 * kAdjustParamater, 85 * kAdjustParamater)];
            shuZiLabel.backgroundColor = self.zhiLiaoFangFaBackGroundColorArray[i];
            shuZiLabel.layer.cornerRadius = shuZiLabel.width / 2;
            shuZiLabel.layer.masksToBounds = YES;
            if ((i + 1) >9) {
                shuZiLabel.text = [NSString stringWithFormat:@"%d", i + 1];
            } else {
                shuZiLabel.text = [NSString stringWithFormat:@"0%d", i + 1];
            }
            
            shuZiLabel.textAlignment = NSTextAlignmentCenter;
            shuZiLabel.textColor = [UIColor whiteColor];
            shuZiLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:50 * kAdjustParamater];
            shuZiLabel.tag = 200 + i;
            [self.backGroundView addSubview:shuZiLabel];
            
            // 治疗内容
            UILabel *zhiLiaoContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(shuZiLabel.right + 27 * kAdjustParamater, shuZiLabel.top + 15 * kAdjustParamater, 195 * kAdjustParamater, 50 * kAdjustParamater)];
            //  zhiLiaoContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
            zhiLiaoContentLabel.text = self.zhiLiaoFangFaArray[i];
            zhiLiaoContentLabel.textColor = [UIColor blackColor];
            zhiLiaoContentLabel.font = [UIFont systemFontOfSize:k17Big];
            zhiLiaoContentLabel.numberOfLines = 0;
            zhiLiaoContentLabel.tag = 300 + i;
            // 动态改变行间距
            [zhiLiaoContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:zhiLiaoContentLabel.text lineHeight:9]];
            [zhiLiaoContentLabel sizeToFit];
            [self.backGroundView addSubview:zhiLiaoContentLabel];
            
            // 判断高度是否大于数字
            if (zhiLiaoContentLabel.height > shuZiLabel.height) {
                zhiLiaoFangFaNextHeight = zhiLiaoFangFaNextHeight + zhiLiaoContentLabel.height + 53 * kAdjustParamater;
            } else if (zhiLiaoContentLabel.height < shuZiLabel.height) {
                zhiLiaoFangFaNextHeight = zhiLiaoFangFaNextHeight + shuZiLabel.height + 53 * kAdjustParamater;
            }
            
            
        } else if (jiOrOu == 0) {
            // 说明是偶数
            
            // 治疗内容
            UILabel *zhiLiaoContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(37 * kAdjustParamater, zhiLiaoFangFaNextHeight + grayLineOnZhiLiaoFangFaTuBiaoBottom.bottom + 27 * kAdjustParamater, 195 * kAdjustParamater, 50 * kAdjustParamater)];
            //   zhiLiaoContentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
            zhiLiaoContentLabel.text = self.zhiLiaoFangFaArray[i];
            zhiLiaoContentLabel.textColor = [UIColor blackColor];
            zhiLiaoContentLabel.font = [UIFont systemFontOfSize:k17Big];
            zhiLiaoContentLabel.numberOfLines = 0;
            zhiLiaoContentLabel.tag = 300 + i;
            // 动态改变行间距
            [zhiLiaoContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:zhiLiaoContentLabel.text lineHeight:9]];
            [zhiLiaoContentLabel sizeToFit];
            [self.backGroundView addSubview:zhiLiaoContentLabel];
            
            // 数字
            UILabel *shuZiLabel = [[UILabel alloc] initWithFrame:CGRectMake(260 * kAdjustParamater, zhiLiaoContentLabel.top - 15 * kAdjustParamater, 85 * kAdjustParamater, 85 * kAdjustParamater)];
            shuZiLabel.backgroundColor = self.zhiLiaoFangFaBackGroundColorArray[i];
            shuZiLabel.layer.cornerRadius = shuZiLabel.width / 2;
            shuZiLabel.layer.masksToBounds = YES;
            if ((i + 1) >9) {
                shuZiLabel.text = [NSString stringWithFormat:@"%d", i + 1];
            } else {
                shuZiLabel.text = [NSString stringWithFormat:@"0%d", i + 1];
            }
            shuZiLabel.textAlignment = NSTextAlignmentCenter;
            shuZiLabel.textColor = [UIColor whiteColor];
            shuZiLabel.tag = 200 + i;
            shuZiLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:50 * kAdjustParamater];
            [self.backGroundView addSubview:shuZiLabel];
            
            // 判断高度是否大于数字
            if (zhiLiaoContentLabel.height > shuZiLabel.height) {
                zhiLiaoFangFaNextHeight = zhiLiaoFangFaNextHeight + zhiLiaoContentLabel.height + 40 * kAdjustParamater;
            } else if (zhiLiaoContentLabel.height < shuZiLabel.height) {
                zhiLiaoFangFaNextHeight = zhiLiaoFangFaNextHeight + shuZiLabel.height + 40 * kAdjustParamater;
            }
        }
    }
    if (self.zhiLiaoFangFaArray.count == 0) {
        self.backGroundView.contentSize = CGSizeMake(kScreenWidth, grayLineOnZhiLiaoFangFaTuBiaoBottom.bottom + 170 * kAdjustParamater);
    } else {
        // 获取治疗方法中最后一个数字和内容
        UILabel *lastZhiLiaoContentLabel = (UILabel *)[self.view viewWithTag:299 + self.zhiLiaoFangFaArray.count];
        UIView *lastShuZiOnZhiLiaoFangFaView = (UIView *)[self.view viewWithTag:199 + self.zhiLiaoFangFaArray.count];
        // 重新定义scrollView的高度
        if (lastZhiLiaoContentLabel.height > lastShuZiOnZhiLiaoFangFaView.height) {
            self.backGroundView.contentSize = CGSizeMake(kScreenWidth, lastZhiLiaoContentLabel.bottom + 170 * kAdjustParamater);
        } else if (lastZhiLiaoContentLabel.height < lastShuZiOnZhiLiaoFangFaView.height) {
            self.backGroundView.contentSize = CGSizeMake(kScreenWidth, lastShuZiOnZhiLiaoFangFaView.bottom + 170 * kAdjustParamater);
        }
    }
    
    
#warning 购买套餐
    
//    if (self.onLineProductArray.count > 0) {
//        UIButton *gouMaiButton = [UIButton buttonWithType:UIButtonTypeSystem];
//        gouMaiButton.backgroundColor = kCyanColor;
//        gouMaiButton.frame  =CGRectMake(0, kScreenHeight - 57 * kAdjustParamater - 64, kScreenWidth, 57 * kAdjustParamater);
//        //   [gouMaiButton setTitle:@"￥299 立即购买疾病风险监测套餐" forState:UIControlStateNormal];
//        [gouMaiButton setTitleColor:[UIColor whiteColor] forState: UIControlStateNormal];
//        gouMaiButton.titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
//        [self.view addSubview:gouMaiButton];
//        OnLineProductModel *model = self.onLineProductArray[0];
//        [gouMaiButton addTarget:self action:@selector(gouMaiBtnClick:) forControlEvents:UIControlEventTouchUpInside];
//        if ([model.is_promotion isEqualToString:@"1"]) {
//            // 说明促销
//            
//            NSString *string1 = [NSString stringWithFormat:@"￥ %@ 立即购买%@套餐", model.promotion_price, model.name];
//            [gouMaiButton setTitle:string1 forState:UIControlStateNormal];
//        } else if ([model.is_promotion isEqualToString:@"0"]) {
//            // 说明不促销
//            NSString *string1 = [NSString stringWithFormat:@"￥ %@ 立即购买%@套餐", model.price, model.name];
//            [gouMaiButton setTitle:string1 forState:UIControlStateNormal];
//        }
//        
//    }
    
    
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{

}

//立即购买整个产品包
-(void)gouMaiBtnClick:(UIButton *)sender
{
    MyOrderViewController *vc=[MyOrderViewController new];
    OnLineProductModel *model = self.onLineProductArray[0];
    vc.model=model;
    [self.navigationController pushViewController:vc animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden=NO;
    self.tabBarController.tabBar.hidden=YES;
    [self.navigationController.navigationBar setTranslucent:NO];
}




/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
